﻿Ext.define('passport.view.factory.FactoryListView' ,{
    extend: 'Ext.grid.Panel',
    alias : 'widget.factoryListView',
		store: 'FactoryStore',
		bodyBorder : false,
		border:0,
		padding: 0,
		frame : true,
		tbar:
		{
	        xtype: 'toolbar',
	        items: [
		        {
		            text: 'New',
		            action: 'create'
		        },
		        {
		         		text: 'Delete',
		            action: 'delete'
		        }
		        ,
		        {
		         		text: 'Refresh',
		            action: 'refresh'
		        }
		      ]
		  },
		  bbar:{
				xtype: 'pagingtoolbar',
				store: 'FactoryStore',
				dock: 'bottom',
				displayInfo: true	
		  },
		
		listeners: {
			select: function(record) {
				console.log("u selected "+record.shortName);
			}
		},
    initComponent: function() {
        this.columns = [
        		{header: 'Id',  dataIndex: 'id',  width: 60},
            {header: 'Code',  dataIndex: 'code',   width: 60},
            {header: 'Short Name', dataIndex: 'shortName',  width: 100},
            {header: 'Full Name',  dataIndex: 'fullName',   width: 100},
            {header: 'Location',  dataIndex: 'location',   width: 100},
            {header: 'Address',  dataIndex: 'address',   width: 160},
            {header: 'Tel',  dataIndex: 'tel',   width: 60},
            {header: 'Contact',  dataIndex: 'contact',   width: 100},
            {header: 'Active',  dataIndex: 'isActive',   flex: 1}
        ];
        this.callParent(arguments);
    }
});
